<?php
/* @var $this SiteController */

$this->pageTitle=Yii::app()->name;
?>

<h1>Welcome to <i><?php echo CHtml::encode(Yii::app()->name); ?></i></h1>

<div class="form">
<?php echo CHtml::beginForm(); ?>
 
<?php echo CHtml::errorSummary($model); ?>
 
<div class="row">
<?php echo CHtml::activeLabel($model,'id'); ?>
<?php echo CHtml::activeTextField($model,'id'); ?>
</div>

<div class="row">
<?php echo CHtml::activeLabel($model,'name'); ?>
<?php echo CHtml::activeTextField($model,'name'); ?>
</div>

<div class="row">
<?php echo CHtml::activeLabel($model,'yes'); ?>
<?php echo CHtml::activeCheckBox($model,'yes'); ?>
</div>
 

<div class="row submit">
<?php echo CHtml::submitButton('go'); ?>
</div>
 
<?php echo CHtml::endForm(); ?>
</div><!-- form -->


<hr>

<?php echo CHtml::ajaxButton("ajax-get",  CHtml::normalizeUrl(array('AjaxButton')), array(
					'success' => 'js:function(data){alert(data);}',
					'error'=> 'js:function(){alert(\'error\');}',
					//beforeSend, complete
			)
		); ?>
		
<hr>

<p>form2</p>

<!-- form2 -->



<div class="form">

	<?php $form = $this->beginWidget('CActiveForm', array(
	 	  'id'=>'form2',
	  	  'enableAjaxValidation'=>true,
	)); ?>
  <p class="note">Fields with <span class="required">*</span> are required.</p>

  <?php echo $form->errorSummary($model); ?>

  <div class="row">
    <?php echo $form->labelEx($model,'id'); ?>
    <?php echo $form->textField($model,'id'); ?>
  </div>
  

  <div class="row">
    <?php echo $form->labelEx($model,'name'); ?>
    <?php echo $form->textArea($model,'name',array('rows'=>4, 'cols'=>30)); ?>
    <?php echo $form->error($model,'name'); ?>
  </div>
  
  <div class="row">
        <?php echo $form->labelEx($model,'date'); ?>
        <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
   			'name' => 'date',
   			'model' => $model,
   			'attribute' => 'date',
   			'language' => 'ru',
   			'options' => array(
       			'showAnim' => 'fold', //'slide','fold','slideDown','fadeIn','blind','bounce','clip','drop'
   			),
   			'htmlOptions' => array(
       			'style' => 'height:20px;'
   			)
	));?> 
	</div>
	
  <div class="row">
    <?php echo $form->checkBoxList($model,'list_check', array(1 => 'a', 2 => 'b', 3 => 'c'), 
    		array(
					'labelOptions' =>	array('style' => "display: inline-block")
    			)
    	); ?>
  </div>
  	
  
  <div class="row">
  	<?php echo $form->labelEx($model, 'yes'); ?>
  	<?php echo $form->checkBox($model, 'yes'); ?>
  </div>
  
  <div class="row">
  	<?php echo $form->labelEx($model, 'date2'); ?>
  	<?php echo $form->dateField($model, 'date2'); ?>
  </div>
  
  <div class="row">
  	<?php echo $form->labelEx($model, 'drop1'); ?>
  	<?php echo $form->dropDownList($model, 'drop1', array(1,2,3)); ?>
  </div>
  
  <div class="row">
  	<?php echo $form->labelEx($model, 'mail1'); ?>
  	<?php echo $form->emailField($model, 'mail1'); ?>
  	<?php echo $form->error($model, 'mail1'); ?>
  </div>
  
   <div class="row">
  	<?php echo $form->labelEx($model, 'searchf'); ?>
  	<?php echo $form->searchField($model, 'searchf'); ?>
  </div>
  
  
	<div class="row submit">
	<?php echo CHtml::submitButton('go'); ?>
	</div>
  
<?php  $this->endWidget(); ?>



